package com.stu.day11.factory2;

import com.stu.day11.factory1.BirdA;
import com.stu.day11.factory1.BirdB;
import com.stu.day11.factory1.Flyable;

/**
 * 工厂方法设计模式
 * 多静态方法
 * @author zy
 * @date 2025/2/3 18:55
 */
public class BirdFactory2 {
    public static Flyable createBirdA(){
        return new BirdA();
    }
    public static Flyable createBirdB(){
        return new BirdB();
    }
}
class Factory2Test{
    public static void main(String[] args) {
        Flyable birdA = BirdFactory2.createBirdA();
        Flyable birdB = BirdFactory2.createBirdB();

        birdA.fly();
        birdB.fly();
    }
}